using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using AopLoadBalancer.Server.BusinessLogic;

namespace AopLoadBalancer.Sample.Server
{
    public class Global : System.Web.HttpApplication
    {
        //public static bool isFirst = true;

        private static AliveNotifier aliveNotifier;
        private static AliveHostTracker aliveHostTracker;


        public static AliveNotifier AliveNotifier{

            get { return aliveNotifier; }
        }


        public static AliveHostTracker AliveHostTracker
        {
            get { return aliveHostTracker; }
        }


        public static string ServiceId
        {
            get { return "AopLoadBalance.Sample"; }
        }

        public static string ServiceUrl
        {
            get { return "http://localhost:1619/Service.asmx"; }
        }

        protected void Application_Start(object sender, EventArgs e)
        {
            aliveNotifier = new AliveNotifier(ServiceUrl, ServiceId);
            aliveHostTracker = new AliveHostTracker(ServiceId, ServiceUrl);

            aliveNotifier.Enabled = true;
        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}